home *** CD-ROM | disk | FTP | other *** search
- /* This program genie.c created by Delrina and assigned to the Genie session*/
- /* runs an automated logon script for connecting to Genie. */
-
- /* $Revision: 1.2 $ */
- /* $Date: 27 Oct 1995 14:42:44 $ */
-
- /* Define main function, which is always the starting point of C programs. */
- /* (The term "void" indicates that the function returns no value.) */
- void main()
- {
- /* Declare variables */
- long ScriptHandle;
- int ReturnValue;
- char Buffer[128], LogLine[128];
-
- /* Initialize variables */
- ReturnValue = 0;
- ScriptHandle = 0;
-
- /* Establish a link between this script program and Delrina WinComm PRO */
- ScriptHandle = dcInitialize(0,0,0,0);
-
- /* Exit if intialization of link with Delrina WinComm PRO failed */
- if (ScriptHandle == 0) exit();
-
- /* Type three 'h's then <enter> */
- if (ReturnValue >= 0)
- ReturnValue = dcTypeText(ScriptHandle, 0, "hhh\r");
-
- /* Wait for a prompt */
- if (ReturnValue >= 0)
- ReturnValue = dcWaitForPrompt(ScriptHandle, 1, "U#=", 300L, 32000L);
-
- /* Get User ID value from Runtime Values dialog box */
- if (ReturnValue >= 0)
- ReturnValue = dcGetRuntimeValue(ScriptHandle, 2, 1, 128, Buffer);
-
- /* Add value to logline */
- if (ReturnValue >= 0)
- strncat(LogLine, Buffer, strlen(Buffer)-1);
-
- /* Get Password value from Runtime Values dialog box */
- if (ReturnValue >= 0)
- ReturnValue = dcGetRuntimeValue(ScriptHandle, 3, 1, 128, Buffer);
-
- /* Add a comma, then the password value to the logline */
- if (ReturnValue >= 0)
- {
- strcat(LogLine, ",");
- strcat(LogLine, Buffer);
- }
-
- /* Type the logline */
- if (ReturnValue >= 0)
- ReturnValue = dcTypeText(ScriptHandle, 0, LogLine);
-
- /* Terminate link between Delrina WinComm PRO and script program */
- dcTerminate(ScriptHandle, 0);
- }
-
-
-